Optimal. Leaf size=205 \[ -\frac {\left (a^2+10 b^2\right ) \cot (c+d x)}{a^6 d}+\frac {2 b \cot ^2(c+d x)}{a^5 d}-\frac {\cot ^3(c+d x)}{3 a^4 d}-\frac {4 b \left (a^2+5 b^2\right ) \log (\tan (c+d x))}{a^7 d}+\frac {4 b \left (a^2+5 b^2\right ) \log (a+b \tan (c+d x))}{a^7 d}-\frac {b \left (a^2+b^2\right )}{3 a^4 d (a+b \tan (c+d x))^3}-\frac {b \left (a^2+2 b^2\right )}{a^5 d (a+b \tan (c+d x))^2}-\frac {b \left (3 a^2+10 b^2\right )}{a^6 d (a+b \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 205, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3597, 908}
\begin {gather*} \frac {2 b \cot ^2(c+d x)}{a^5 d}-\frac {\cot ^3(c+d x)}{3 a^4 d}-\frac {4 b \left (a^2+5 b^2\right ) \log (\tan (c+d x))}{a^7 d}+\frac {4 b \left (a^2+5 b^2\right ) \log (a+b \tan (c+d x))}{a^7 d}-\frac {b \left (3 a^2+10 b^2\right )}{a^6 d (a+b \tan (c+d x))}-\frac {\left (a^2+10 b^2\right ) \cot (c+d x)}{a^6 d}-\frac {b \left (a^2+2 b^2\right )}{a^5 d (a+b \tan (c+d x))^2}-\frac {b \left (a^2+b^2\right )}{3 a^4 d (a+b \tan (c+d x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 908
Rule 3597
Rubi steps
\begin {align*} \int \frac {\csc ^4(c+d x)}{(a+b \tan (c+d x))^4} \, dx &=\frac {b \text {Subst}\left (\int \frac {b^2+x^2}{x^4 (a+x)^4} \, dx,x,b \tan (c+d x)\right )}{d}\\ &=\frac {b \text {Subst}\left (\int \left (\frac {b^2}{a^4 x^4}-\frac {4 b^2}{a^5 x^3}+\frac {a^2+10 b^2}{a^6 x^2}-\frac {4 \left (a^2+5 b^2\right )}{a^7 x}+\frac {a^2+b^2}{a^4 (a+x)^4}+\frac {2 \left (a^2+2 b^2\right )}{a^5 (a+x)^3}+\frac {3 a^2+10 b^2}{a^6 (a+x)^2}+\frac {4 \left (a^2+5 b^2\right )}{a^7 (a+x)}\right ) \, dx,x,b \tan (c+d x)\right )}{d}\\ &=-\frac {\left (a^2+10 b^2\right ) \cot (c+d x)}{a^6 d}+\frac {2 b \cot ^2(c+d x)}{a^5 d}-\frac {\cot ^3(c+d x)}{3 a^4 d}-\frac {4 b \left (a^2+5 b^2\right ) \log (\tan (c+d x))}{a^7 d}+\frac {4 b \left (a^2+5 b^2\right ) \log (a+b \tan (c+d x))}{a^7 d}-\frac {b \left (a^2+b^2\right )}{3 a^4 d (a+b \tan (c+d x))^3}-\frac {b \left (a^2+2 b^2\right )}{a^5 d (a+b \tan (c+d x))^2}-\frac {b \left (3 a^2+10 b^2\right )}{a^6 d (a+b \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(528\) vs. \(2(205)=410\).
time = 2.21, size = 528, normalized size = 2.58 \begin {gather*} \frac {\sec ^4(c+d x) (a \cos (c+d x)+b \sin (c+d x)) \left (-192 b \left (a^2+5 b^2\right ) \log (\sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3+192 b \left (a^2+5 b^2\right ) \log (a \cos (c+d x)+b \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3-\frac {\csc ^3(c+d x) \left (8 a^8-4 a^6 b^2-50 a^4 b^4-190 a^2 b^6-150 b^8+3 \left (3 a^8+10 a^6 b^2+45 a^4 b^4+115 a^2 b^6+75 b^8\right ) \cos (2 (c+d x))+6 \left (2 a^6 b^2-17 a^4 b^4-35 a^2 b^6-15 b^8\right ) \cos (4 (c+d x))-a^8 \cos (6 (c+d x))-22 a^6 b^2 \cos (6 (c+d x))+17 a^4 b^4 \cos (6 (c+d x))+55 a^2 b^6 \cos (6 (c+d x))+15 b^8 \cos (6 (c+d x))-3 a^7 b \sin (2 (c+d x))+3 a^5 b^3 \sin (2 (c+d x))-75 a^3 b^5 \sin (2 (c+d x))-75 a b^7 \sin (2 (c+d x))-6 a^7 b \sin (4 (c+d x))+84 a^5 b^3 \sin (4 (c+d x))+156 a^3 b^5 \sin (4 (c+d x))+60 a b^7 \sin (4 (c+d x))-3 a^7 b \sin (6 (c+d x))-65 a^5 b^3 \sin (6 (c+d x))-79 a^3 b^5 \sin (6 (c+d x))-15 a b^7 \sin (6 (c+d x))\right )}{a^2+b^2}\right )}{48 a^7 d (a+b \tan (c+d x))^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.46, size = 184, normalized size = 0.90
method | result | size |
derivativedivides | \(\frac {-\frac {b \left (3 a^{2}+10 b^{2}\right )}{a^{6} \left (a +b \tan \left (d x +c \right )\right )}-\frac {\left (a^{2}+b^{2}\right ) b}{3 a^{4} \left (a +b \tan \left (d x +c \right )\right )^{3}}-\frac {b \left (a^{2}+2 b^{2}\right )}{a^{5} \left (a +b \tan \left (d x +c \right )\right )^{2}}+\frac {4 b \left (a^{2}+5 b^{2}\right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{a^{7}}-\frac {1}{3 a^{4} \tan \left (d x +c \right )^{3}}-\frac {a^{2}+10 b^{2}}{a^{6} \tan \left (d x +c \right )}+\frac {2 b}{a^{5} \tan \left (d x +c \right )^{2}}-\frac {4 b \left (a^{2}+5 b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )}{a^{7}}}{d}\) | \(184\) |
default | \(\frac {-\frac {b \left (3 a^{2}+10 b^{2}\right )}{a^{6} \left (a +b \tan \left (d x +c \right )\right )}-\frac {\left (a^{2}+b^{2}\right ) b}{3 a^{4} \left (a +b \tan \left (d x +c \right )\right )^{3}}-\frac {b \left (a^{2}+2 b^{2}\right )}{a^{5} \left (a +b \tan \left (d x +c \right )\right )^{2}}+\frac {4 b \left (a^{2}+5 b^{2}\right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{a^{7}}-\frac {1}{3 a^{4} \tan \left (d x +c \right )^{3}}-\frac {a^{2}+10 b^{2}}{a^{6} \tan \left (d x +c \right )}+\frac {2 b}{a^{5} \tan \left (d x +c \right )^{2}}-\frac {4 b \left (a^{2}+5 b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )}{a^{7}}}{d}\) | \(184\) |
risch | \(-\frac {4 i \left (-a^{6} b -26 a^{4} b^{3}+420 a^{2} b^{5} {\mathrm e}^{8 i \left (d x +c \right )}+270 a^{2} b^{5} {\mathrm e}^{2 i \left (d x +c \right )}-6 a^{4} b^{3} {\mathrm e}^{10 i \left (d x +c \right )}-174 a^{2} b^{5} {\mathrm e}^{10 i \left (d x +c \right )}-3 a^{6} b \,{\mathrm e}^{8 i \left (d x +c \right )}-3 i a^{7} {\mathrm e}^{8 i \left (d x +c \right )}-8 i a^{7} {\mathrm e}^{6 i \left (d x +c \right )}-124 a^{4} b^{3} {\mathrm e}^{6 i \left (d x +c \right )}-160 a^{2} b^{5} {\mathrm e}^{6 i \left (d x +c \right )}-30 b^{7}-56 b^{5} a^{2}-96 i a^{3} b^{4} {\mathrm e}^{10 i \left (d x +c \right )}+30 i a^{5} b^{2} {\mathrm e}^{8 i \left (d x +c \right )}+60 i a^{3} b^{4} {\mathrm e}^{8 i \left (d x +c \right )}+32 i a^{5} b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+280 i a^{3} b^{4} {\mathrm e}^{6 i \left (d x +c \right )}+120 i a \,b^{6} {\mathrm e}^{10 i \left (d x +c \right )}-450 i a \,b^{6} {\mathrm e}^{8 i \left (d x +c \right )}+600 i a \,b^{6} {\mathrm e}^{6 i \left (d x +c \right )}-48 i a^{5} b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-300 i a^{3} b^{4} {\mathrm e}^{4 i \left (d x +c \right )}-300 i a \,b^{6} {\mathrm e}^{4 i \left (d x +c \right )}-24 i a^{5} b^{2} {\mathrm e}^{10 i \left (d x +c \right )}-12 a^{6} b \,{\mathrm e}^{4 i \left (d x +c \right )}-48 a^{4} b^{3} {\mathrm e}^{4 i \left (d x +c \right )}-300 a^{2} b^{5} {\mathrm e}^{4 i \left (d x +c \right )}+114 a^{4} b^{3} {\mathrm e}^{2 i \left (d x +c \right )}-6 i a^{7} {\mathrm e}^{4 i \left (d x +c \right )}+6 a^{6} b \,{\mathrm e}^{10 i \left (d x +c \right )}+56 i a^{3} b^{4}+30 i a \,b^{6}+26 i a^{5} b^{2}+90 a^{4} b^{3} {\mathrm e}^{8 i \left (d x +c \right )}-22 a^{6} b \,{\mathrm e}^{6 i \left (d x +c \right )}-300 b^{7} {\mathrm e}^{4 i \left (d x +c \right )}+150 b^{7} {\mathrm e}^{2 i \left (d x +c \right )}+300 b^{7} {\mathrm e}^{6 i \left (d x +c \right )}+i a^{7}+30 b^{7} {\mathrm e}^{10 i \left (d x +c \right )}-150 b^{7} {\mathrm e}^{8 i \left (d x +c \right )}\right )}{3 \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3} \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+i a \,{\mathrm e}^{2 i \left (d x +c \right )}-b +i a \right )^{3} \left (i a +b \right )^{2} a^{6} d}+\frac {4 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{a^{5} d}+\frac {20 b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{a^{7} d}-\frac {4 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{5} d}-\frac {20 b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{7} d}\) | \(800\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.32, size = 228, normalized size = 1.11 \begin {gather*} \frac {\frac {3 \, a^{4} b \tan \left (d x + c\right ) - 12 \, {\left (a^{2} b^{3} + 5 \, b^{5}\right )} \tan \left (d x + c\right )^{5} - a^{5} - 30 \, {\left (a^{3} b^{2} + 5 \, a b^{4}\right )} \tan \left (d x + c\right )^{4} - 22 \, {\left (a^{4} b + 5 \, a^{2} b^{3}\right )} \tan \left (d x + c\right )^{3} - 3 \, {\left (a^{5} + 5 \, a^{3} b^{2}\right )} \tan \left (d x + c\right )^{2}}{a^{6} b^{3} \tan \left (d x + c\right )^{6} + 3 \, a^{7} b^{2} \tan \left (d x + c\right )^{5} + 3 \, a^{8} b \tan \left (d x + c\right )^{4} + a^{9} \tan \left (d x + c\right )^{3}} + \frac {12 \, {\left (a^{2} b + 5 \, b^{3}\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{7}} - \frac {12 \, {\left (a^{2} b + 5 \, b^{3}\right )} \log \left (\tan \left (d x + c\right )\right )}{a^{7}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 1235 vs.
\(2 (201) = 402\).
time = 0.43, size = 1235, normalized size = 6.02 \begin {gather*} \frac {19 \, a^{6} b^{4} + 51 \, a^{4} b^{6} + 30 \, a^{2} b^{8} + 2 \, {\left (a^{10} + 23 \, a^{8} b^{2} - 22 \, a^{6} b^{4} - 138 \, a^{4} b^{6} - 90 \, a^{2} b^{8}\right )} \cos \left (d x + c\right )^{6} - 3 \, {\left (a^{10} + 25 \, a^{8} b^{2} - 46 \, a^{6} b^{4} - 206 \, a^{4} b^{6} - 130 \, a^{2} b^{8}\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (9 \, a^{8} b^{2} - 38 \, a^{6} b^{4} - 131 \, a^{4} b^{6} - 80 \, a^{2} b^{8}\right )} \cos \left (d x + c\right )^{2} + 6 \, {\left (a^{6} b^{4} + 7 \, a^{4} b^{6} + 11 \, a^{2} b^{8} + 5 \, b^{10} + {\left (3 \, a^{8} b^{2} + 20 \, a^{6} b^{4} + 26 \, a^{4} b^{6} + 4 \, a^{2} b^{8} - 5 \, b^{10}\right )} \cos \left (d x + c\right )^{6} - 3 \, {\left (2 \, a^{8} b^{2} + 13 \, a^{6} b^{4} + 15 \, a^{4} b^{6} - a^{2} b^{8} - 5 \, b^{10}\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (a^{8} b^{2} + 6 \, a^{6} b^{4} + 4 \, a^{4} b^{6} - 6 \, a^{2} b^{8} - 5 \, b^{10}\right )} \cos \left (d x + c\right )^{2} - {\left ({\left (a^{9} b + 4 \, a^{7} b^{3} - 10 \, a^{5} b^{5} - 28 \, a^{3} b^{7} - 15 \, a b^{9}\right )} \cos \left (d x + c\right )^{5} - {\left (a^{9} b + a^{7} b^{3} - 31 \, a^{5} b^{5} - 61 \, a^{3} b^{7} - 30 \, a b^{9}\right )} \cos \left (d x + c\right )^{3} - 3 \, {\left (a^{7} b^{3} + 7 \, a^{5} b^{5} + 11 \, a^{3} b^{7} + 5 \, a b^{9}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )\right )} \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) - 6 \, {\left (a^{6} b^{4} + 7 \, a^{4} b^{6} + 11 \, a^{2} b^{8} + 5 \, b^{10} + {\left (3 \, a^{8} b^{2} + 20 \, a^{6} b^{4} + 26 \, a^{4} b^{6} + 4 \, a^{2} b^{8} - 5 \, b^{10}\right )} \cos \left (d x + c\right )^{6} - 3 \, {\left (2 \, a^{8} b^{2} + 13 \, a^{6} b^{4} + 15 \, a^{4} b^{6} - a^{2} b^{8} - 5 \, b^{10}\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (a^{8} b^{2} + 6 \, a^{6} b^{4} + 4 \, a^{4} b^{6} - 6 \, a^{2} b^{8} - 5 \, b^{10}\right )} \cos \left (d x + c\right )^{2} - {\left ({\left (a^{9} b + 4 \, a^{7} b^{3} - 10 \, a^{5} b^{5} - 28 \, a^{3} b^{7} - 15 \, a b^{9}\right )} \cos \left (d x + c\right )^{5} - {\left (a^{9} b + a^{7} b^{3} - 31 \, a^{5} b^{5} - 61 \, a^{3} b^{7} - 30 \, a b^{9}\right )} \cos \left (d x + c\right )^{3} - 3 \, {\left (a^{7} b^{3} + 7 \, a^{5} b^{5} + 11 \, a^{3} b^{7} + 5 \, a b^{9}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )\right )} \log \left (-\frac {1}{4} \, \cos \left (d x + c\right )^{2} + \frac {1}{4}\right ) + {\left (2 \, {\left (3 \, a^{9} b + 77 \, a^{7} b^{3} + 142 \, a^{5} b^{5} + 34 \, a^{3} b^{7} - 30 \, a b^{9}\right )} \cos \left (d x + c\right )^{5} - {\left (3 \, a^{9} b + 193 \, a^{7} b^{3} + 350 \, a^{5} b^{5} + 26 \, a^{3} b^{7} - 120 \, a b^{9}\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (15 \, a^{7} b^{3} + 23 \, a^{5} b^{5} - 14 \, a^{3} b^{7} - 20 \, a b^{9}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{3 \, {\left ({\left (3 \, a^{13} b + 5 \, a^{11} b^{3} + a^{9} b^{5} - a^{7} b^{7}\right )} d \cos \left (d x + c\right )^{6} - 3 \, {\left (2 \, a^{13} b + 3 \, a^{11} b^{3} - a^{7} b^{7}\right )} d \cos \left (d x + c\right )^{4} + 3 \, {\left (a^{13} b + a^{11} b^{3} - a^{9} b^{5} - a^{7} b^{7}\right )} d \cos \left (d x + c\right )^{2} + {\left (a^{11} b^{3} + 2 \, a^{9} b^{5} + a^{7} b^{7}\right )} d - {\left ({\left (a^{14} - a^{12} b^{2} - 5 \, a^{10} b^{4} - 3 \, a^{8} b^{6}\right )} d \cos \left (d x + c\right )^{5} - {\left (a^{14} - 4 \, a^{12} b^{2} - 11 \, a^{10} b^{4} - 6 \, a^{8} b^{6}\right )} d \cos \left (d x + c\right )^{3} - 3 \, {\left (a^{12} b^{2} + 2 \, a^{10} b^{4} + a^{8} b^{6}\right )} d \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc ^{4}{\left (c + d x \right )}}{\left (a + b \tan {\left (c + d x \right )}\right )^{4}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.68, size = 222, normalized size = 1.08 \begin {gather*} -\frac {\frac {12 \, {\left (a^{2} b + 5 \, b^{3}\right )} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a^{7}} - \frac {12 \, {\left (a^{2} b^{2} + 5 \, b^{4}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{7} b} + \frac {12 \, a^{2} b^{3} \tan \left (d x + c\right )^{5} + 60 \, b^{5} \tan \left (d x + c\right )^{5} + 30 \, a^{3} b^{2} \tan \left (d x + c\right )^{4} + 150 \, a b^{4} \tan \left (d x + c\right )^{4} + 22 \, a^{4} b \tan \left (d x + c\right )^{3} + 110 \, a^{2} b^{3} \tan \left (d x + c\right )^{3} + 3 \, a^{5} \tan \left (d x + c\right )^{2} + 15 \, a^{3} b^{2} \tan \left (d x + c\right )^{2} - 3 \, a^{4} b \tan \left (d x + c\right ) + a^{5}}{{\left (b \tan \left (d x + c\right )^{2} + a \tan \left (d x + c\right )\right )}^{3} a^{6}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.06, size = 232, normalized size = 1.13 \begin {gather*} \frac {8\,b\,\mathrm {atanh}\left (\frac {4\,b\,\left (a^2+5\,b^2\right )\,\left (a+2\,b\,\mathrm {tan}\left (c+d\,x\right )\right )}{a\,\left (4\,a^2\,b+20\,b^3\right )}\right )\,\left (a^2+5\,b^2\right )}{a^7\,d}-\frac {\frac {1}{3\,a}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (a^2+5\,b^2\right )}{a^3}-\frac {b\,\mathrm {tan}\left (c+d\,x\right )}{a^2}+\frac {22\,b\,{\mathrm {tan}\left (c+d\,x\right )}^3\,\left (a^2+5\,b^2\right )}{3\,a^4}+\frac {10\,b^2\,{\mathrm {tan}\left (c+d\,x\right )}^4\,\left (a^2+5\,b^2\right )}{a^5}+\frac {4\,b^3\,{\mathrm {tan}\left (c+d\,x\right )}^5\,\left (a^2+5\,b^2\right )}{a^6}}{d\,\left (a^3\,{\mathrm {tan}\left (c+d\,x\right )}^3+3\,a^2\,b\,{\mathrm {tan}\left (c+d\,x\right )}^4+3\,a\,b^2\,{\mathrm {tan}\left (c+d\,x\right )}^5+b^3\,{\mathrm {tan}\left (c+d\,x\right )}^6\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________